package com.example.list

import com.chad.library.adapter.base.BaseMultiItemQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

/**
 * @Author : mjc
 * time    : 2021-05-13
 * desc    : 商品适配器
 */
class ShopAdapter : BaseMultiItemQuickAdapter<ShopModel.Data.Children, BaseViewHolder>() {
    init {
        addItemType(0, R.layout.item_shop_head_layout)
        addItemType(1, R.layout.item_shop_layout)
    }

    override fun convert(holder: BaseViewHolder, item: ShopModel.Data.Children) {
        when (item.itemType) {
            0 -> {
                holder.setText(R.id.tvTitle, item.label)
            }
            1 ->{
                holder.setText(R.id.tvShopName, item.label)
            }
        }
    }
}